package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;
import java.time.Instant;

/**
 * 商品属性表
 */
@ApiModel(description = "商品属性表")
@Entity
@Table(name = "merchandise_attributes")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class MerchandiseAttributes implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 属性编码
     */
    @ApiModelProperty(value = "属性编码")
    @Column(name = "attribute_code")
    private String attributeCode;

    /**
     * 属性名称
     */
    @ApiModelProperty(value = "属性名称")
    @Column(name = "attribute_name")
    private String attributeName;

    /**
     * 商品编码
     */
    @ApiModelProperty(value = "商品编码")
    @Column(name = "merchandise_code")
    private String merchandiseCode;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @Column(name = "status")
    private Boolean status;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Instant createTime;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMerchandiseCode() {
        return merchandiseCode;
    }

    public void setMerchandiseCode(String merchandiseCode) {
        this.merchandiseCode = merchandiseCode;
    }

    public String getAttributeCode() {
        return attributeCode;
    }

    public MerchandiseAttributes attributeCode(String attributeCode) {
        this.attributeCode = attributeCode;
        return this;
    }

    public void setAttributeCode(String attributeCode) {
        this.attributeCode = attributeCode;
    }

    public String getAttributeName() {
        return attributeName;
    }

    public MerchandiseAttributes attributeName(String attributeName) {
        this.attributeName = attributeName;
        return this;
    }

    public void setAttributeName(String attributeName) {
        this.attributeName = attributeName;
    }

    public Boolean isStatus() {
        return status;
    }

    public MerchandiseAttributes status(Boolean status) {
        this.status = status;
        return this;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Instant getCreateTime() {
        return createTime;
    }

    public MerchandiseAttributes createTime(Instant createTime) {
        this.createTime = createTime;
        return this;
    }

    public void setCreateTime(Instant createTime) {
        this.createTime = createTime;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MerchandiseAttributes)) {
            return false;
        }
        return id != null && id.equals(((MerchandiseAttributes) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "MerchandiseAttributes{" +
            "id=" + getId() +
            ", attributeCode='" + getAttributeCode() + "'" +
            ", attributeName='" + getAttributeName() + "'" +
            ", status='" + isStatus() + "'" +
            ", createTime='" + getCreateTime() + "'" +
            "}";
    }
}
